/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DatosEcocardiogramaPanel.java
 *
 * Created on 17/01/2011, 17:22:06
 */

package presentacion.examen;

import hibernate.objeto.EcocardiogramaEstudioCardiologia;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JDialog;
import javax.swing.JSpinner.DefaultEditor;
import logica.CapaLogica;
import presentacion.CapaPresentacion;
import presentacion.utilidad.maquetado.Fuente;

/**
 *
 * @author Gonzalo
 */
public class DatosEcocardiogramaPanel extends javax.swing.JPanel {

    /** Creates new form DatosEcocardiogramaPanel */
    public DatosEcocardiogramaPanel() {
        initComponents();
        setearEventosQueCapturanTeclaEnterYEscape();
    }

    /**
     * Setea datos de la ventana.
     *
     */
    public void personalizarJDialog(EcocardiogramaEstudioCardiologia
            ecocardiogramaEstudioCardiologia) {
        this.ecocardiogramaEstudioCardiologia =
                ecocardiogramaEstudioCardiologia;
            exhibirDatosEnPantalla();
            if(CapaPresentacion.modoVisualizacion) {
                inhabilitarCampos();
            }
    }

    /**
     * Permite visualizar los detalles de la evolución.
     *
     */
    private void exhibirDatosEnPantalla() {
        dDVIEcocardiograma.setValue(
                ecocardiogramaEstudioCardiologia.
                getDdviEcocardiogramaEstudioCardiologia());
        dSVIEcocardiograma.setValue(
                ecocardiogramaEstudioCardiologia.
                getDsviEcocardiogramaEstudioCardiologia());
        aIEcocardiograma.setValue(
                ecocardiogramaEstudioCardiologia.
                getAiEcocardiogramaEstudioCardiologia());
        fAEcocardiograma.setValue(
                ecocardiogramaEstudioCardiologia.
                getFaEcocardiogramaEstudioCardiologia());
        fEyEcocardiograma.setValue(
                ecocardiogramaEstudioCardiologia.
                getFeyEcocardiogramaEstudioCardiologia());
        funcionGlogalEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getFuncionGlogalDelViEcocardiogramaEstudioCardiologia());
        funcionGlogalEcocardiograma.setCaretPosition(0);
        valvulasEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getValvulasEcocardiogramaEstudioCardiologia());
        valvulasEcocardiograma.setCaretPosition(0);
        motilidadParietalEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getMotilidadParietalEcocardiogramaEstudioCardiologia());
        motilidadParietalEcocardiograma.setCaretPosition(0);
        eTEEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getEteEcocardiogramaEstudioCardiologia());
        eTEEcocardiograma.setCaretPosition(0);
        eTTEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getEttEcocardiogramaEstudioCardiologia());
        eTTEcocardiograma.setCaretPosition(0);
        conclusionesEcocardiograma.setText(
                ecocardiogramaEstudioCardiologia.
                getConclusionesEcocardiogramaEstudioCardiologia());
        conclusionesEcocardiograma.setCaretPosition(0);
    }

    /**
     * Pone en false la propiedad enabled de todos los campos de ingreso.
     *
     */
    private void inhabilitarCampos() {
        dDVIEcocardiograma.setEnabled(false);
        dSVIEcocardiograma.setEnabled(false);
        aIEcocardiograma.setEnabled(false);
        fAEcocardiograma.setEnabled(false);
        fEyEcocardiograma.setEnabled(false);
        funcionGlogalEcocardiograma.setEnabled(false);
        valvulasEcocardiograma.setEnabled(false);
        motilidadParietalEcocardiograma.setEnabled(false);
        eTEEcocardiograma.setEnabled(false);
        eTTEcocardiograma.setEnabled(false);
        conclusionesEcocardiograma.setEnabled(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textoDDVIEcocardiograma = new javax.swing.JLabel();
        dDVIEcocardiograma = new javax.swing.JSpinner();
        textoDSVIEcocardiograma = new javax.swing.JLabel();
        dSVIEcocardiograma = new javax.swing.JSpinner();
        fEyEcocardiograma = new javax.swing.JSpinner();
        textoAIEcocardiograma = new javax.swing.JLabel();
        aIEcocardiograma = new javax.swing.JSpinner();
        textoFEyEcocardiograma = new javax.swing.JLabel();
        textoFuncionGlogalDelVIEcocardiograma = new javax.swing.JLabel();
        textoFAEcocardiograma = new javax.swing.JLabel();
        fAEcocardiograma = new javax.swing.JSpinner();
        textoETEEcocardiograma = new javax.swing.JLabel();
        textoETTEcocardiograma = new javax.swing.JLabel();
        textoValvulasEcocardiograma = new javax.swing.JLabel();
        textoMotilidadParietalEcocardiograma = new javax.swing.JLabel();
        textoConclusionesEcocardiograma = new javax.swing.JLabel();
        conclusionesEcocardiogramaScrollPane = new javax.swing.JScrollPane();
        conclusionesEcocardiograma = new javax.swing.JTextArea();
        valvulasEcocardiograma = new javax.swing.JTextField();
        motilidadParietalEcocardiograma = new javax.swing.JTextField();
        eTTEcocardiograma = new javax.swing.JTextField();
        eTEEcocardiograma = new javax.swing.JTextField();
        funcionGlogalEcocardiograma = new javax.swing.JTextField();

        textoDDVIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoDDVIEcocardiograma.setText("DDVI (cm)");
        textoDDVIEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        dDVIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        dDVIEcocardiograma.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f)));
        dDVIEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        textoDSVIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoDSVIEcocardiograma.setText("DSVI (cm)");
        textoDSVIEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        dSVIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        dSVIEcocardiograma.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f)));
        dSVIEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        fEyEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        fEyEcocardiograma.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f)));
        fEyEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        textoAIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoAIEcocardiograma.setText("AI (cm)");
        textoAIEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        aIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        aIEcocardiograma.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f)));
        aIEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        textoFEyEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoFEyEcocardiograma.setText("FEy (%)");
        textoFEyEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoFuncionGlogalDelVIEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoFuncionGlogalDelVIEcocardiograma.setText("Función glogal del VI");
        textoFuncionGlogalDelVIEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoFAEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoFAEcocardiograma.setText("FA (%)");
        textoFAEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        fAEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        fAEcocardiograma.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(1.0f)));
        fAEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        textoETEEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoETEEcocardiograma.setText("ETE");
        textoETEEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoETTEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoETTEcocardiograma.setText("ETT");
        textoETTEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoValvulasEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoValvulasEcocardiograma.setText("Válvulas");
        textoValvulasEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoMotilidadParietalEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoMotilidadParietalEcocardiograma.setText("Motilidad parietal");
        textoMotilidadParietalEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        textoConclusionesEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        textoConclusionesEcocardiograma.setText("Conclusiones");
        textoConclusionesEcocardiograma.setPreferredSize(new java.awt.Dimension(102, 20));

        conclusionesEcocardiogramaScrollPane.setPreferredSize(new java.awt.Dimension(242, 80));

        conclusionesEcocardiograma.setColumns(10);
        conclusionesEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        conclusionesEcocardiograma.setRows(1);
        conclusionesEcocardiograma.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
        conclusionesEcocardiogramaScrollPane.setViewportView(conclusionesEcocardiograma);

        valvulasEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        valvulasEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        motilidadParietalEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        motilidadParietalEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        eTTEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        eTTEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        eTEEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        eTEEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        funcionGlogalEcocardiograma.setFont(Fuente.FUENTE_TEXTFIELD);
        funcionGlogalEcocardiograma.setPreferredSize(new java.awt.Dimension(70, 20));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(textoDDVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoDSVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoAIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoFEyEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoFAEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoFuncionGlogalDelVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoValvulasEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoMotilidadParietalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoETTEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoETEEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoConclusionesEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(dDVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dSVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(aIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fEyEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fAEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(eTEEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(eTTEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(motilidadParietalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(valvulasEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(funcionGlogalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(conclusionesEcocardiogramaScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoDDVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dDVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoDSVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dSVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoAIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(aIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoFEyEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fEyEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoFAEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fAEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoFuncionGlogalDelVIEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(funcionGlogalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoValvulasEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(valvulasEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoMotilidadParietalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(motilidadParietalEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoETTEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(eTTEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoETEEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(eTEEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textoConclusionesEcocardiograma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(conclusionesEcocardiogramaScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    

    /**
     * Recopila los datos del panel para colocarlos dentro del arreglo.
     *
     * @param datosEstudioCardiologia El arreglo a cargar
     */
    public void recopilarDatos(Object[] datosEstudioCardiologia) {

        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_AI] =
                aIEcocardiograma.getValue();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_CONCLUSIONES] =
                conclusionesEcocardiograma.getText();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_DDVI] =
                dDVIEcocardiograma.getValue();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_DSVI] =
                dSVIEcocardiograma.getValue();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_ETE] =
                eTEEcocardiograma.getText();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_ETT] =
                eTTEcocardiograma.getText();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_FA] =
                fAEcocardiograma.getValue();
        datosEstudioCardiologia[CapaLogica.ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_FEY] =
                fEyEcocardiograma.getValue();
        datosEstudioCardiologia[CapaLogica.
                ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_FUNCION_GLOGAL_DEL_VI] =
                funcionGlogalEcocardiograma.getText();
        datosEstudioCardiologia[CapaLogica.
                ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_MOTILIDAD_PARIETAL] =
                motilidadParietalEcocardiograma.getText();
        datosEstudioCardiologia[CapaLogica.
                ESTUDIO_CARDIOLOGIA_ECOCARDIOGRAMA_VALVULAS] =
                valvulasEcocardiograma.getText();
    }

    /**
     * Setea en cada componente del JDialog los eventos que capturarán la tecla
     * enter y escape.
     */
    private void setearEventosQueCapturanTeclaEnterYEscape() {
        //Declaración del evento a capturar
        KeyListener keyListenerEscape = new KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
                    cerrarVentana();
                }
            }
        };

        //Setear eventos
        ((DefaultEditor) dDVIEcocardiograma.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);
        ((DefaultEditor) dSVIEcocardiograma.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);
        ((DefaultEditor) aIEcocardiograma.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);
        ((DefaultEditor) fEyEcocardiograma.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);
        ((DefaultEditor) fAEcocardiograma.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);
        funcionGlogalEcocardiograma.addKeyListener(keyListenerEscape);
        valvulasEcocardiograma.addKeyListener(keyListenerEscape);
        motilidadParietalEcocardiograma.addKeyListener(keyListenerEscape);
        eTEEcocardiograma.addKeyListener(keyListenerEscape);
        eTTEcocardiograma.addKeyListener(keyListenerEscape);
        conclusionesEcocardiograma.addKeyListener(keyListenerEscape);
    }

    private void cerrarVentana() {
        JDialog jdialog = (JDialog)
                this.getParent().getParent().getParent().getParent().
                getParent().getParent().getParent().getParent().
                getParent().getParent().getParent().getParent().getParent();
        jdialog.dispose();
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JSpinner aIEcocardiograma;
    private javax.swing.JTextArea conclusionesEcocardiograma;
    private javax.swing.JScrollPane conclusionesEcocardiogramaScrollPane;
    private javax.swing.JSpinner dDVIEcocardiograma;
    private javax.swing.JSpinner dSVIEcocardiograma;
    private javax.swing.JTextField eTEEcocardiograma;
    private javax.swing.JTextField eTTEcocardiograma;
    private javax.swing.JSpinner fAEcocardiograma;
    private javax.swing.JSpinner fEyEcocardiograma;
    private javax.swing.JTextField funcionGlogalEcocardiograma;
    private javax.swing.JTextField motilidadParietalEcocardiograma;
    private javax.swing.JLabel textoAIEcocardiograma;
    private javax.swing.JLabel textoConclusionesEcocardiograma;
    private javax.swing.JLabel textoDDVIEcocardiograma;
    private javax.swing.JLabel textoDSVIEcocardiograma;
    private javax.swing.JLabel textoETEEcocardiograma;
    private javax.swing.JLabel textoETTEcocardiograma;
    private javax.swing.JLabel textoFAEcocardiograma;
    private javax.swing.JLabel textoFEyEcocardiograma;
    private javax.swing.JLabel textoFuncionGlogalDelVIEcocardiograma;
    private javax.swing.JLabel textoMotilidadParietalEcocardiograma;
    private javax.swing.JLabel textoValvulasEcocardiograma;
    private javax.swing.JTextField valvulasEcocardiograma;
    // End of variables declaration//GEN-END:variables
    private EcocardiogramaEstudioCardiologia ecocardiogramaEstudioCardiologia;
}
